package com.bhs.sansong.adapter;

import androidx.annotation.NonNull;

import com.bhs.sansong.R;
import com.bhs.sansong.bean.BillBean;
import com.bhs.sansong.utils.DateUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

public class BillAdapter extends BaseQuickAdapter<BillBean, BaseViewHolder> {

    public BillAdapter() {
        super(R.layout.item_bill);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, BillBean item) {
        helper.setText(R.id.tv_bill, item.getLog_type_msg());
        helper.setText(R.id.tv_money, Double.parseDouble(item.getNumber())>0?String.format("+%s",item.getNumber()):item.getNumber());
        helper.setText(R.id.tv_time, DateUtils.getTime2(item.getCreate_time()));
    }
}
